package com.alipay.sofa.demo.db.core.consumer;

import com.alipay.sofa.demo.db.common.entity.StudentInfoDTO;
import com.alipay.sofa.demo.db.common.tool.ProtostuffUtil;
import org.apache.kafka.common.serialization.Deserializer;
import java.util.Map;

/**
 * @Author Zhang Da
 * @Date 2020/2/15 21:17
 * @Version 1.0
 */
public class StudentInfoDeserializer implements Deserializer<StudentInfoDTO> {
    @Override
    public void configure(Map<String, ?> map, boolean b) {}

    @Override
    public StudentInfoDTO deserialize(String topic, byte[] data) {
        return ProtostuffUtil.deserializer(data, StudentInfoDTO.class);
    }

    @Override
    public void close() {}
}
